# 定义Human类，包含age,.appelite bilod.height weigh属性和eat.sieep, celebrate,grow方法;
# 其中appetite是饭量,celebrate是过生日，grow是长高1cm;
# 实现int方法初始化
class Human:
    def __init__(self, age, appetite, blood, height, weight):
        self.age = age
        self.appetite = appetite
        self.blood = blood
        self.height = height
        self.weight = weight

    def eat(self):
        print("I am eating")

    def sleep(self):
        print("I am sleeping")

    def celebrate(self):
        print("It's my birthday!")

    def grow(self):
        self.height += 1
        print("I have grown 1cm")

    def __str__(self):
        return f"Human(age={self.age}, appetite={self.appetite}, blood={self.blood}, height={self.height}, weight={self.weight})"


# 初始化一个Human对象
h = Human(25, "large", "O", 170, 65)
print(h)
h.eat()
h.sleep()
h.celebrate()
h.grow()
print(h)

class Student(Human):
    grade = "2023"

    def __init__(self, age, appetite, blood, height, weight, student_id, score):
        super().__init__(age, appetite, blood, height, weight)
        self.id = student_id
        self.score = score

    def __str__(self):
        return f"Student(id={self.id}, score={self.score}, age={self.age}, appetite={self.appetite}, blood={self.blood}, height={self.height}, weight={self.weight}, grade={self.grade})"
print('---'*50)


# 初始化一个Student对象
s = Student(20, "medium", "A", 165, 55, "2023001", 90)
print(s)
s.eat()
s.sleep()
s.celebrate()
s.grow()
print(s)